function GetDateStep() {

	var myData = [
			['1', '上班时间', "无", "无", '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00'],
			['2', '上班时间', "无", "无", '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00'],
			['3', '上班时间', "无", "无", '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00'],
			['4', '上班时间', "无", "无", '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00'],
			['5', '上班时间', "无", "无", '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00', '09:00:00-18:00:00']


	];


	var store = new Ext.data.ArrayStore({
				fields : [{
							name : 'id'
						}, {
							name : 'name'
						}, {
							name : 'start_date'
						}, {
							name : 'end_date'
						}, {
							name : 'monday'
						}, {
							name : 'tuesday'
						}, {
							name : 'wednesday'
						}, {
							name : 'thursday'
						}, {
							name : 'friday'
						}, {
							name : 'saturday'
						}, {
							name : 'sunday'
						}]
			});
			
	store.loadData(myData);
	var nowpage = new Ext.Toolbar.TextItem('1');
	var countpage = new Ext.Toolbar.TextItem('共1页');
	var now_page = 0;
	var count_page = 0;
	var sm = new Ext.grid.CheckboxSelectionModel();
	var grid = new Ext.grid.GridPanel({
				store : store,
				columns : [sm, {
							id : 'id',
							header : 'id',
							width : 10,
							sortable : true,
							dataIndex : 'id',
							hidden : true
						}, {
							header : '名称',
							width : 150,
							sortable : true,
							dataIndex : 'name'
						}, {
							header : '起始日期',
							width : 70,
							sortable : true,
							dataIndex : 'start_date'
						}, {
							header : '结束日期',
							width : 70,
							sortable : true,
							dataIndex : 'end_date'
						}, {
							header : '星期一',
							width : 100,
							sortable : true,
							dataIndex : 'monday'
						}, {
							header : '星期二',
							width : 100,
							sortable : true,
							dataIndex : 'tuesday'
						}, {
							header : '星期三',
							width : 100,
							sortable : true,
							dataIndex : 'wednesday'
						}, {
							header : '星期四',
							width : 100,
							sortable : true,
							dataIndex : 'thursday'
						}, {
							header : '星期五',
							width : 100,
							sortable : true,
							dataIndex : 'friday'
						}, {
							header : '星期六',
							width : 100,
							sortable : true,
							dataIndex : 'saturday'
						}, {
							header : '星期日',
							width : 100,
							sortable : true,
							dataIndex : 'sunday'
						}],
				sm : sm,
				tbar : [{
				            text:'添加',
				            tooltip : '添加',
				            iconCls: 'add', 
							handler : function() {
								DateStepWindows(datestepReturn);
							}
				        },'-',{
							text : '编辑',
							tooltip : '编辑',
							iconCls : 'modify',
							handler : function() {
								DateStepWindows(datestepReturn);
							}
						}, '-', {
							text : '删除',
							tooltip : '删除',
							iconCls : 'delete',
							ref : '../removeBtn',
							disabled : true,
							handler : function() {
								var s = grid.getSelectionModel().getSelections();
								for (var i = 0; r = s[i]; i++) {
									store.remove(r);
								}
							}
						}, '-', {
							text : '刷新',
							tooltip : '刷新',
							iconCls : 'refresh',
							handler : function() {							
								store.loadData(myData);
							}
						}],
				bbar : [{
					tooltip : '首页',
					handler : function() {
						reflashgriad(0);
					},
					iconCls : 'frist'
				}, {

					tooltip : '上一页',
					handler : function() {
						reflashgriad(now_page - 1);
					},
					iconCls : 'perv'
				}, nowpage, {

					tooltip : '下一页',
					handler : function() {
						reflashgriad(now_page + 1);
					},
					iconCls : 'next'
				}, {

					tooltip : '最后一页',
					handler : function() {
						reflashgriad(Math.ceil(count_page / 20) - 1);
					},
					iconCls : 'last'
				}, {
					xtype : "tbfill"
				}, countpage],
				stripeRows : true,
				autoExpandColumn : 'id',
				stateful : true,
				stateId : 'grid'
			});
	grid.getSelectionModel().on('selectionchange', function(sm) {
				grid.removeBtn.setDisabled(sm.getCount() < 1);
			});

	function datestepReturn(data){
		var jsondata = Ext.util.JSON.decode(data);
		
	}

	function reflashgriad(page) {
	}
	
	
	
	return grid;
}


function DateStepWindows(datestepReturn){

	var date_north = {
		xtype: 'fieldset',
		margins:'5 5 5 5',
		layout: 'form',
		height: 115,
		region:'north',
		title: '基本信息',
		items: [
		{
			xtype: 'textfield',
			name: 'name',
			id  : 'name',
			fieldLabel: '名称',
			anchor: '100%'
		},{
			xtype: 'datefield',
			name: 'start_date',
			id: 'start_date',
			fieldLabel: '起始日期',
			anchor: '100%'
		},{
			xtype: 'datefield',
			name: 'end_date',
			id: 'end_date',
			fieldLabel: '结束日期',
			anchor: '100%'
		}

		]
	};


	
	var weekData = [
			['1', '周一', '09:00:00', '18:00:00'],
			['2', '周二', '09:00:00', '18:00:00'],
			['3', '周三', '09:00:00', '18:00:00'],
			['4', '周四', '09:00:00', '18:00:00'],
			['5', '周五', '09:00:00', '18:00:00']
	];


	var weekStore = new Ext.data.ArrayStore({
				fields : [{
							name : 'id'
						}, {
							name : 'weeks'
						}, {
							name : 'start_time'
						}, {
							name : 'end_time'
						}]
			});

	weekStore.loadData(weekData);
	var sm = new Ext.grid.CheckboxSelectionModel();
	var weekgrid = new Ext.grid.GridPanel({
				store : weekStore,
				columns : [sm, {
							id : 'id',
							header : 'id',
							width : 10,
							sortable : true,
							dataIndex : 'id',
							hidden : true
						}, {
							header : '星期',
							width : 100,
							sortable : true,
							dataIndex : 'weeks'
						}, {
							header : '起始时间',
							width : 100,
							sortable : true,
							dataIndex : 'start_time'
						}, {
							header : '结束时间',
							width : 100,
							sortable : true,
							dataIndex : 'end_time'
						}],
				sm : sm,
				tbar : [{
							text : '添加',
							tooltip : '添加',
							iconCls : 'add',
							handler : function() {
								WeekTimeWindows(weektimeReturn);
							}
						},'-',{
							text : '编辑',
							tooltip : '编辑',
							iconCls : 'modify',
							handler : function() {
								WeekTimeWindows(weektimeReturn);
							}
						},'-',{
							text : '删除',
							tooltip : '删除',
							iconCls : 'delete',
							ref : '../removeBtn',
							disabled : true,
							handler : function() {
							}
						}],
				stripeRows : true,
				autoExpandColumn : 'id',
				region : 'center'
			});
	function weektimeReturn(data){
		var jsondata = Ext.util.JSON.decode(data);
		
	}

	var date_center = {
		xtype: 'fieldset',
		margins:'5 5 5 5',
		title: '周期',
		layout : 'border',
		region:'center',
		items: [weekgrid]
	};
	var dateWindows = new Ext.Window({
				layout : 'border',
				width : 600,
				height : 500,
				title : "时段",
				modal : true,
				resizable : true,
				maximizable : true,
				iconCls : 'time',
				items : [date_north,date_center],
				plain : true
			});
	dateWindows.addButton({
				text : "确定",
				handler : function() {
					var data = "{name:'" + Ext.get("name").getValue() + "',start_date:'" + Ext.get("start_date").getValue() + "',end_date:'" + Ext.get("end_date").getValue() + "'}";
					datestepReturn(data);
					dateWindows.close();
				}
			});
	dateWindows.addButton({
				text : '取 消',
				handler : function() {
					dateWindows.close();
				}
			});
	dateWindows.show();
}
function WeekTimeWindows(weektimeReturn){

	var states = [
		['1', '星期一'],
		['2', '星期二'],
		['3', '星期三'],
		['4', '星期四'],
		['5', '星期五'],
		['6', '星期六'],
		['7', '星期日']
		];

	var WeekTime_center = {
		xtype: 'fieldset',
		margins:'5 5 5 5',
		layout : 'form',
		region:'center',
		bodyStyle : 'padding:10px;',
		items: [
		{
			fieldLabel: '星期',
			xtype : 'combo',
			name : 'week',
			frame : true,
			id : 'week',
			store : new Ext.data.ArrayStore({
					fields : ['abbr', 'state'],
					data : states
				}),
			valueField : 'abbr',
			displayField : 'state',
			typeAhead : true,
			mode : 'local',
			triggerAction : 'all',
			value : '1',
			editable : false,
			anchor: '100%'
		},{
			xtype: 'timefield',
			name: 'start_time',
			id  : 'start_time',
			format: 'H:i',
			fieldLabel: '起始时间',
			value:'00:00',
			anchor: '100%'
		},{
			xtype: 'timefield',
			name: 'end_time',
			id  : 'end_time',
			format: 'H:i',
			fieldLabel: '结束时间',
			value:'00:00',
			anchor: '100%'
		}
	
		]
	};

	var WeekTimeWindows = new Ext.Window({
				layout : 'border',
				width : 400,
				height : 200,
				title : "周期",
				modal : true,
				resizable : true,
				maximizable : true,
				iconCls : 'time',
				items : [WeekTime_center],
				plain : true
				
			});
	WeekTimeWindows.addButton({
				text : "确定",
				handler : function() {
					var data = "{week:'" + Ext.getCmp("week").getValue() + "',start_time:'" + Ext.get("start_time").getValue() + "',end_time:'" + Ext.get("end_time").getValue() + "'}";
					weektimeReturn(data);
					WeekTimeWindows.close();
				}
			});
	WeekTimeWindows.addButton({
				text : '取 消',
				handler : function() {
					WeekTimeWindows.close();
				}
			});
	WeekTimeWindows.show();
}	